function __serverName(){if(typeof process!='undefined'){if(process.env.NODE_ENV == 'development'){return "/youyaboot-admin";}}var href = window.location.href.replace("https://","").replace("http://","");if(href.indexOf("/magicalcoder/")==-1){return "/youyaboot-admin";}var pre = href.split("?")[0];var arr = pre.split("/magicalcoder/");if(arr[0].indexOf("/")==-1){return "";}var newArr = arr[0].split("/");newArr[0]="";var realPath = newArr.join("/");return realPath;}
if(typeof String.prototype.endsWith != 'function') {String.prototype.endsWith = function (suffix){return this.slice(-1*suffix.length) === suffix;};}var __import = function(imports){var resources = [];for(var i=0;i<imports.length;i++){if(!imports[i]){continue;}if(imports[i].endsWith(".js")|| (imports[i].indexOf(".js?")!=-1) ){resources.push('<script src="'+imports[i]+'" type="text/javascript"></sc' + 'ript>');}else if(imports[i].endsWith(".css")|| (imports[i].indexOf(".css?")!=-1)){resources.push('<link href='+imports[i]+' rel="stylesheet" type="text/css" />');}}document.write(resources.join(''));}
/*
    您自定义的组件的渲染逻辑都可以在下面引入进来:这些资源是脱离布局器独立运行的最小化依赖资源
*/
var __getParameter = function (name,location) {
    var location = location || window.location;
    var href = location.href;
    if(href.indexOf("?")==-1){
        return null;
    }
    var query = location.href.split("?")[1];
    if(query!=''){
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("=");
            if(pair.length=2){
                if(pair[0] == name){return pair[1];}
            }
        }
    }
    return null;
}
var __projectUuid = __getParameter("pid")||__getParameter("projectUuid",parent.location)
var __pageUuid = __getParameter("id")
var useVite = __getParameter("type",parent.location)=='3';
if(window.location.href.indexOf("view.html")!=-1){//弹窗预览的时候 不用vite
    useVite=false;
    __pageUuid = null;
}else if(window.location.href.indexOf("iframe-element.html")!=-1){//设计阶段
    __pageUuid = null;
}
var _serverNameConst = __serverName();
__import([
    "assets/drag/js/user/iframe/element/latest/components/import-need.js"
])

function IframeComponents (){
}
/*这个方法会在html渲染完主动执行 已经写入constant.js的defaultJavascript默认脚本了*/
IframeComponents.prototype.execute = function(param){
    //删除进度条 页面渲染完 会执行这里
    if(document.getElementById("__mc_loading")){document.getElementById("__mc_loading").remove();}
    //赋能
    window.MC.vdata = window.vueData;
    window.MC.vue = window.vueMc;
    //检测下工作流页面
    {
        var activiti = MC.url("activiti");
        if(activiti=='my-apply' || activiti=='my-finish-task'){//我的发起 我的已处理 禁止操作了
            //
            document.getElementById("magicalDragScene").classList.add("mc-disabled-yes")
        }
    }
    //从后台获取需要加载的资源
    var iframeComponents = ___mcUtils.iframeComponents;
    for(var i=0;i<iframeComponents.length;i++){
        var component = iframeComponents[i];
        if(component['render']){
            component.render(param);
        }else{
            console.log("以下组件缺少render方法"+component)
        }
    }
}
